<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>函数为对象的函数</title>
</head>
<body>
   
    <script>
    
        {
            // 参数为对象的参数
            function fn (person) {
                person.age = 100;
                person = {
                    name: 'ws',
                    age: 30
                };
                return person;
            }

            let p1 = {
                name: 'ww',
                age: 2
            };
            
            console.log(fn(p1));
        }
    
    </script>

</body>
</html>